\(\int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx\) [190]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 4 \[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=x+\cos (x) \]

[Out]

x+cos(x)

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {4476, 2761, 8} \[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=x+\cos (x) \]

[In]

Int[Cos[x]/(Sec[x] + Tan[x]),x]

[Out]

x + Cos[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2761

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[g*((g*Cos[e
 + f*x])^(p - 1)/(b*f*(p - 1))), x] + Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2), x], x] /; FreeQ[{a, b, e, f, g
}, x] && EqQ[a^2 - b^2, 0] && GtQ[p, 1] && IntegerQ[2*p]

Rule 4476

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos ^2(x)}{1+\sin (x)} \, dx \\ & = \cos (x)+\int 1 \, dx \\ & = x+\cos (x) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(63\) vs. \(2(4)=8\).

Time = 0.09 (sec) , antiderivative size = 63, normalized size of antiderivative = 15.75 \[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=-\frac {\cos ^3(x) \left (2 \arcsin \left (\frac {\sqrt {1-\sin (x)}}{\sqrt {2}}\right ) \sqrt {1-\sin (x)}+(-1+\sin (x)) \sqrt {1+\sin (x)}\right )}{(-1+\sin (x))^2 (1+\sin (x))^{3/2}} \]

[In]

Integrate[Cos[x]/(Sec[x] + Tan[x]),x]

[Out]

-((Cos[x]^3*(2*ArcSin[Sqrt[1 - Sin[x]]/Sqrt[2]]*Sqrt[1 - Sin[x]] + (-1 + Sin[x])*Sqrt[1 + Sin[x]]))/((-1 + Sin
[x])^2*(1 + Sin[x])^(3/2)))

Maple [A] (verified)

Time = 1.44 (sec) , antiderivative size = 5, normalized size of antiderivative = 1.25

method result size
risch \(x +\cos \left (x \right )\) \(5\)
default \(\frac {2}{1+\tan \left (\frac {x}{2}\right )^{2}}+2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )\) \(21\)

[In]

int(cos(x)/(sec(x)+tan(x)),x,method=_RETURNVERBOSE)

[Out]

x+cos(x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=x + \cos \left (x\right ) \]

[In]

integrate(cos(x)/(sec(x)+tan(x)),x, algorithm="fricas")

[Out]

x + cos(x)

Sympy [F]

\[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=\int \frac {\cos {\left (x \right )}}{\tan {\left (x \right )} + \sec {\left (x \right )}}\, dx \]

[In]

integrate(cos(x)/(sec(x)+tan(x)),x)

[Out]

Integral(cos(x)/(tan(x) + sec(x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 30 vs. \(2 (4) = 8\).

Time = 0.29 (sec) , antiderivative size = 30, normalized size of antiderivative = 7.50 \[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=\frac {2}{\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1} + 2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

integrate(cos(x)/(sec(x)+tan(x)),x, algorithm="maxima")

[Out]

2/(sin(x)^2/(cos(x) + 1)^2 + 1) + 2*arctan(sin(x)/(cos(x) + 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 14 vs. \(2 (4) = 8\).

Time = 0.28 (sec) , antiderivative size = 14, normalized size of antiderivative = 3.50 \[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=x + \frac {2}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1} \]

[In]

integrate(cos(x)/(sec(x)+tan(x)),x, algorithm="giac")

[Out]

x + 2/(tan(1/2*x)^2 + 1)

Mupad [B] (verification not implemented)

Time = 22.65 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (x)}{\sec (x)+\tan (x)} \, dx=x+\cos \left (x\right ) \]

[In]

int(cos(x)/(tan(x) + 1/cos(x)),x)

[Out]

x + cos(x)